package com.acwing.partition3;

import java.io.*;
import java.util.Arrays;

/**
 * @author `RKC`
 * @date 2021/11/28 15:44
 */
public class AC291蒙德里安的梦想 {

    private static final int N = 13;
    //f[i][j]表示i-1列已经摆放好，且从i-1列伸到i列的状态为j的所有合法方案数
    private static long[][] f = new long[N][1 << N];
    private static boolean[] st = new boolean[1 << N];

    private static int n = 0, m = 0;

    private static final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    private static final BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws IOException {
        for (;;) {
            String[] ss = reader.readLine().split(" ");
            n = Integer.parseInt(ss[0]);
            m = Integer.parseInt(ss[1]);
            if (n == 0 || m == 0) break;
            if (n * m % 2 == 1) writer.write("0\n");
            else writer.write(resolve() + "\n");
        }
        writer.flush();
    }

    private static long resolve() {
        init();
        f[0][0] = 1;
        for (int i = 1; i <= m; i++) {
            for (int cur = 0; cur < 1 << n; cur++) {
                for (int pre = 0; pre < 1 << n; pre++) {
                    if ((cur & pre) != 0 || !st[cur | pre]) continue;
                    f[i][cur] += f[i - 1][pre];
                }
            }
        }
        return f[m][0];
    }

    private static void init() {
        Arrays.fill(st, false);
        for (int i = 0; i < N; i++) Arrays.fill(f[i], 0);
        for (int i = 0; i < 1 << n; i++) {
            st[i] = true;
            //记录连续0的数量
            int cnt = 0;
            for (int j = 0; j < n; j++) {
                if ((i >> j & 1) == 1) {
                    if ((cnt & 1) == 1) {
                        st[i] = false;
                        break;
                    }
                    cnt = 0;
                } else cnt++;
            }
            if ((cnt & 1) == 1) st[i] = false;
        }
    }
}
